#ifndef _HDL_LED_H_
#define _HDL_LED_H_

#include "bsp.h"

#define LED_GPIO_GPIO_PeriphClockFunc   RCC_APB2PeriphClockCmd
#define LED_GPIO_GPIO_PeriphClock       RCC_APB2Periph_GPIOA
#define LED_GPIO_PORT                   GPIOA
#define LED_RED                         GPIO_Pin_0
#define LED_GREEN                       GPIO_Pin_1


#define LED_RED_TOGGLE  {LED_GPIO_PORT -> ODR ^=LED_RED;}
#define LED_GREEN_TOGGLE {LED_GPIO_PORT -> ODR ^=LED_GREEN;}

//输出低电平
#define LED_RED_LOW     {LED_GPIO_PORT -> BSRRH = LED_RED;}
#define LED_GREEN_LOW   {LED_GPIO_PORT -> BSRRH = LED_GREEN;}

//输出高电平
#define LED_RED_HIGH     {LED_GPIO_PORT -> BSRRL = LED_RED;}
#define LED_GREEN_HIGH   {LED_GPIO_PORT -> BSRRL = LED_GREEN;}

extern struct hal_led_if g_hdl_led_if;

#endif
